package com.cristina.attention.handler.impl;

import com.cristina.attention.domain.MessageInfo;
import com.cristina.attention.handler.ImHandler;
import com.cristina.attention.service.MessageService;
import com.cristina.attention.utils.OkHttpUtil;
import com.cristina.attention.utils.enums.ChannelType;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 群聊消息同步
 *
 * @author by superman
 */
@Component
public class GroupChatHandler extends ImHandler {

    @Resource
    private MessageService messageService;

    public GroupChatHandler() {
        channelCode = ChannelType.IM_GROUP.getCode();
    }

    @Override
    public void handler(MessageInfo taskInfo) {
        messageService.syncGroupMessageRecord(taskInfo.getMsgContext());
    }
}
